test(sql): run test postgres natively without docker#4715
Conversation
Replace the five Docker-backed process-compose services with native processes so `just demo-native` needs no Docker daemon: - demo-l1-network: custom geth-l1 image -> native anvil (from foundry) - espresso-node-db-0/1: docker postgres -> scripts/run-postgres - keydb: docker keydb -> native redis-server - telemetry-collector (vector) and block-explorer: dropped flake.nix adds redis and bumps postgresql_16 -> postgresql_18. cleanup-process-compose drops the docker compose teardown and reaps anvil/postgres/redis-server.
- run-postgres: break readiness loop on shutdown signal so a SIGTERM during startup does not spin (pg_isready never succeeds against a shutting-down server); skip createdb when shutting down - run-postgres: correct DATADIR docs (initdb creates the dir) - bind anvil and redis to 127.0.0.1 instead of all interfaces
The native demo previously ran the L1, CDN store, and node DBs as Docker containers, so the test-integration and demo-native jobs only needed process-compose. Now those run natively (anvil, redis-server, postgres), which were absent on the runner and broke every native demo job with 'anvil: command not found'. Add install-native-demo-deps: installs foundry (anvil), redis-server and postgresql, stops the auto-started redis/postgres services so the demo can bind its own ports, and puts the postgres server binaries on PATH.
The Push-CDN broker heartbeat uses KeyDB's EXPIREMEMBER command, which plain redis does not implement, so brokers never registered and the CDN was dead (the demo limped along on the libp2p secondary; the non-PoS->PoS epoch upgrade tests stalled). The standalone cdn-broker/cdn-marshal pick their discovery client at compile time (Redis), so SQLite/embedded discovery is not selectable. KeyDB is not in nixpkgs and has no clean macOS build, so nix/keydb.nix repackages prebuilt binaries: the official keydb-tools .deb relocated via autoPatchelfHook on Linux, and the Homebrew bottle (openssl relocated + re-signed) on macOS aarch64. CI extracts the .deb directly.
autoPatchelfHook failed on the keydb-tools .deb for libbz2.so.1.0, liblz4.so.1, libz.so.1 and libsystemd.so.0, which broke the default nix devShell build and every nix-develop CI job (contracts, etc.). Add the full DT_NEEDED set.
TmpDb spawned a `docker run postgres` container. Replace it with a native `initdb` + `postgres` server on a reserved TCP port, connecting as the `postgres` superuser to the default `postgres` database over trust auth (same surface the docker image exposed). Shutdown uses `pg_ctl stop -m fast` with a SIGKILL fallback; the datadir is removed on Drop. CI: add an install-postgres composite action (server binaries onto PATH) and wire it into test-postgres, slowtest and coverage; reuse it from install-native-demo-deps. Add install-foundry to coverage. doc/ubuntu.md: install the postgresql server instead of docker, and reduce the executed section to a compile check plus a single migration smoke test.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
# Conflicts: # .github/actions/install-native-demo-deps/action.yml
TmpDb spawned a
docker run postgrescontainer. Replace it with a nativeinitdb+postgresserver on a reserved TCP port, connecting as thepostgressuperuser to the defaultpostgresdatabase over trust auth (same surface the docker image exposed). Shutdown usespg_ctl stop -m fastwith a SIGKILL fallback; the datadir is removed on Drop.CI: add an install-postgres composite action (server binaries onto PATH) and wire it into test-postgres, slowtest and coverage; reuse it from install-native-demo-deps. Add install-foundry to coverage.
doc/ubuntu.md: install the postgresql server instead of docker, and reduce the executed section to a compile check plus a single migration smoke test.